(function (){
  let bd = document.getElementsByTagName('body')[0];
  let atag = document.querySelectorAll('.del');
  let reset = document.querySelector('.ret');



  bd.style.background = `url(${localStorage.wallpaper}) 0 0 / cover`;
  bd.style.backgroundAttachment = 'fixed';
  atag.forEach((item) => {
    item.addEventListener('click', (e) => {
      e.preventDefault()
      if (window.confirm('确定要删除这个书签吗?')) {
        let url = e.target.getAttribute('href')
        window.location.href = url
      }
    })
  })

  reset.addEventListener('click', (e) => {
    e.preventDefault();
    if (window.confirm('一旦重置，您的所有更改全部恢复到默认状态，不可撤销，请仔细考虑！')) {
      window.location.href = '/reset';
    }
  })
})()